package com.zhuoyue.biz.core.command.cmd.common.faa.base;

/**
 * 雷达指示灯配置时间
 *
 * @author wjming
 */
public enum RadarModeEnum {
    //常灭
    Time1("00", "常灭", "AlwaysTurnOff"),
    //常亮
    Time2("FF", "常亮", "AlwaysLight"),
    //亮10S
    Time3("0A", "10S", "10"),
    //亮60S
    Time4("3C", "60S", "60"),
    //亮30S
    Time5("1E", "30S", "30"),
    ;
    private String mode;
    private String name;
    private String param;

    RadarModeEnum(String mode, String name, String param) {
        this.mode = mode;
        this.name = name;
        this.param = param;
    }

    public String getMode() {
        return mode;
    }

    public String getName() {
        return name;
    }

    public String getParam() {
        return param;
    }

    /**
     * 根据Key得到枚举的Value
     * 普通for循环遍历，比较判断
     *
     * @param key
     * @return
     */
    public static String getRadarModeEnum(String key) {
        RadarModeEnum[] alarmGrades = RadarModeEnum.values();
        for (int i = 0; i < alarmGrades.length; i++) {
            if (alarmGrades[i].getParam().equals(key)) {
                return alarmGrades[i].getMode();
            }
        }
        return "";
    }

}
